const path = require('path');//引入path模块,为配置别名做准备
function resolve(dir){
    return path.join(__dirname,dir)//path.join(__dirname)设置绝对路径
}
module.exports = {
    publicPath: '/', // 基本路径
    chainWebpack: (config) => {
        config.resolve.alias
            .set('@',resolve('./src'))
            .set('components',resolve('./src/components'))
            .set('path_img',resolve('./src/assets/images'))
            .set('path_js',resolve('./src/assets/js'))
            .set('path_style',resolve('./src/assets/style'))
    },
    pluginOptions: {
      'style-resources-loader': {
        preProcessor: 'less',
        patterns: [
            path.resolve(__dirname, './src/assets/style/resize.less')
        ]
      }
    },
    configureWebpack: {
        devtool: 'source-map'
    },
    // devServer: {
    //     proxy: {
    //         '/m': {
    //             target: 'http://vue.yaazi.cn/',
    //             pathRewrite:{'^/m':''},
    //             ws: true,
    //             changeOrigin: true
    //         }
    //     }
    // },
}
